package com.org.config;

import com.org.interceptors.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * ClassName: WebConfig
 * Package: com.org.config
 * Description:
 *
 * @Author Origin
 * @Create 2024/1/27 14:23
 * @Version 1.0
 */

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //登录和注册接口不拦截
        registry.addInterceptor(loginInterceptor).excludePathPatterns("/normalUser/login", "/normalUser/register", "/admin/login",
                "/communityAdmin/register", "/communityAdmin/login", "/upload");
    }
}
